home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks96
/
FlyPaper.sit
/
Fly Paper
/
FlyPaper Source
/
App Sources
/
ST_
/
ST_.h
next >
Wrap
Text File
|
1996-06-22
|
1KB
|
30 lines
#ifndef DECLARE_ST_
#define DECLARE_ST_(CLASSNAME, TYPE, DTOR, SAFEVAL) \
\
class CLASSNAME { \
private: \
TYPE the##TYPE; \
void operator = (const TYPE &a##TYPE); \
public: \
CLASSNAME (const TYPE &a##TYPE) {the##TYPE = a##TYPE;} \
~CLASSNAME () {if (the##TYPE != SAFEVAL) DTOR (the##TYPE);} \
operator TYPE& (void) {return the##TYPE;} \
void Forget (void) {the##TYPE = SAFEVAL;} \
};
#define DECLARE_STP_(CLASSNAME, TYPE, DTOR, SAFEVAL) \
\
class CLASSNAME { \
private: \
TYPE the##TYPE; \
void operator = (const TYPE &a##TYPE); \
public: \
CLASSNAME (const TYPE &a##TYPE) {the##TYPE = a##TYPE;} \
~CLASSNAME () {if (the##TYPE != SAFEVAL) DTOR (&the##TYPE);} \
operator TYPE& (void) {return the##TYPE;} \
void Forget (void) {the##TYPE = SAFEVAL;} \
};
#endif